package practical.two;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

public class CheckBoxesActivity extends Activity
implements View.OnClickListener{
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	
		final CheckBox cbox = (CheckBox) findViewById(R.id.cbox);
		cbox.setOnClickListener(this);
	}
	
    public void onClick(View v) {

		final CheckBox cb = (CheckBox) findViewById(R.id.cbox);
		
        if (cb.isChecked()) {
        	cb.setText("Yes - checked");

        } else {
        	cb.setText("No - not checked");

        }
    }
}